import request from '@/utils/request'

// 查询主导航栏
export function getMenu(query) {
  return request({
    url: '/homepage/navigation',
    method: 'get',
    params: query
  })
}

//查询通知公告
export function getNotice(query) {
  return request({
    url: '/home/zeigen',
    method: 'get',
    params: query
  })
}


//查询首页链接
export function getAllLink(query) {
  return request({
    url: '/link/all',
    method: 'get',
    params: query
  })
}


// 查询主页日期星期
export function getDate() {
  return request({
    url: '/homepage/data',
    method: 'get'
  })
}

//查询分页分层数据,Id=1分页、Id=3人大概况分层、Id=4人大概况分层、Id=5题专栏分层、Id=6网谷里分层、Id=7互动交流分层
export function getPageData(query) {
  return request({
    url: '/displaydata/select',
    method: 'get',
    params: query
  })
}

// 查询文章链接
export function getArticles(query) {
  return request({
    url: '/articles',
    method: 'get',
    params: query
  })
}

//根据父id返回子id
export function getIdByParentId(query) {
  return request({
    url: '/seleccategorybyid',
    method: 'get',
    params: query
  })
}

// 查询文章内容
export function getArticleDetail(query) {
  return request({
    url: '/articlenames',
    method: 'get',
    params: query
  })
}

// 查询代表风采展示
export function getRepList(query) {
  return request({
    url: '/representing/list',
    method: 'get',
    params: query
  })
}

// 查询代表联络站街道
export function getStreetInfo(id) {
  return request({
    url: '/StreetInfo/StreetInfo/' + id,
    method: 'get'
  })
}


// 查询代表联络站
export function getStaionInfo(query) {
  return request({
    url: '/LiaisonStation/LiaisonStation/liaisonstaioninfo',
    method: 'get',
    params: query
  })
}

// 查询代表联络站详情
export function getStaionDetail(id) {
  return request({
    url: '/LiaisonStation/LiaisonStation/' + id,
    method: 'get'
  })
}


// 代表建议展示
export function getSuggestions(query) {
  return request({
    url: '/suggestions',
    method: 'get',
    params: query
  })
}

// 代表建议详情展示
export function getSuggestionsDetail(query) {
  return request({
    url: '/suggestions/suggestions/' + query.id,
    method: 'get',
    params: ""
  })
}


// 代表历史履职
export function getRepWorkList(query) {
  return request({
    url: '/FrontdeskRepresentative/list',
    method: 'get',
    params: query
  })
}

// 新增代表历史履职
export function addRepWork(data) {
  return request({
    url: '/FrontdeskRepresentative/add',
    method: 'post',
    data: data
  })
}

//民情动态列表
export function getTrendsList(query) {
  return request({
    url: '/PublicOpinion/PublicOpinion/list',
    method: 'get',
    params: query
  })
}

//根据用户ID查民情动态列表
export function findByVoterId(query) {
  return request({
    url: '/PublicOpinion/PublicOpinion/findByVoterId',
    method: 'get',
    params: query
  })
}

//根据民情动态详情
export function getTrendsDetail(id) {
  return request({
    url: '/PublicOpinion/PublicOpinion/'+id,
    method: 'get',
  })
}


//民情动态查询人员
export function getTrendsUserList(query) {
  return request({
    url: '/publicopinion/selectuserinfo',
    method: 'get',
    params: query
  })
}

// 民情动态上传
export function addTrends(data) {
  return request({
    url: '/publicopinion/add',
    method: 'post',
    data: data
  })
}

// 登录
export function login(data) {
  return request({
    url: '/userinfo/userinfo/userLogin',
    method: 'post',
    data: data
  })
}

// 注册
export function register(data) {
  return request({
    url: '/userinfo/userinfo/add',
    method: 'post',
    data: data
  })
}

// 重置密码
export function forget(data) {
  return request({
    url: 'userinfo/userinfo/updatePwd',
    method: 'post',
    data: data
  })
}



